package com.hualan.service;

import com.hualan.domain.Course;
import com.hualan.domain.Teacher;
import com.hualan.mapper.CourseMapper;
import com.hualan.mapper.TeacherMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class KeChengService {
    @Autowired
   private TeacherMapper teacherMapper;
    @Autowired
    private CourseMapper courseMapper;
    //查询老师表
    public List<Teacher> AllTeacherService(){
        List<Teacher> teacherList =teacherMapper.selectAllTeacher();
        if (teacherList==null){
            return null;
        }else{
            return teacherList;
        }
    }

//全部课程
    public List<Course> AllCourseService(){
        return courseMapper.selAllCourse();

    }
    //模糊查询
    public List<Course> LikeCourseService(String coursename){
        return  courseMapper.selLikeCourse(coursename);
    }
}
